# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=openscad
pkgver=2019.05
pkgrel=2
pkgdesc="The programmers solid 3D CAD modeller"
url="http://openscad.org/"
arch="all !armhf !mips !mips64" # Limited by qt5-qtmultimedia that needs qt5-delcarative
license="GPL-2.0-only"
subpackages="$pkgname-doc"
makedepends="
	bison
	boost-dev
	cgal-dev
	double-conversion-dev
	eigen-dev
	flex
	glew-dev
	gmp-dev
	harfbuzz-dev
	lib3mf-dev
	libxml2-dev
	libzip-dev
	mpfr-dev
	opencsg-dev
	qscintilla-dev
	qt5-qtbase-dev
	qt5-qtmultimedia-dev
	"
checkdepends="
	cmake
	imagemagick
	libx11
	python3
	xorgproto
	xvfb-run
	"
source="https://files.openscad.org/openscad-$pkgver.src.tar.gz
	boost-1.72.patch"
options="!check" # Tests fail in xvfb, but pass on real X server

build() {
	qmake-qt5 PREFIX="/usr"
	# fix issue with #include_next stdlib.h
	sed -e 's/-isystem \/usr\/include //g' -i Makefile
	make
}

check() {
	cd tests
	cmake .
	make
	#xvfb-run ctest # Tests fail in xvfb, but pass on real X server
	ctest
}

package() {
	make INSTALL_ROOT="$pkgdir" install
}

sha512sums="073053f625ffa4fea6ed836396b7ff4b87b26cf7500b06c804983afc0f1dfd3d78bfb81b3fd217c3939b0ec915d85b0c7990773eaf968512a150deaa0399df13  openscad-2019.05.src.tar.gz
8cd01ce250975440bdc4515bd5acb13b39853b9c03b0368eea3e998752c80f57026db34ff653194461fb3e5187ff3f084943bc0ddc599bbaa100a9003ba7494a  boost-1.72.patch"
